{% extends 'bms_home.html' %}


{% block content %}
    <h2 class="text-center">图书添加</h2>
    <form action="" method="post" class="form-group">
        <p>书名:
            <input type="text" class="form-control" name="title">
        </p>
        <p>价格:
            <input type="text" class="form-control" name="price">
        </p>
        <p>出版日期:
            <input type="date" class="form-control" name="publish_time">
        </p>
        <p>出版社:
            {# 展示作者所有的出版社信息供用户选择一个 #}
            <select name="publish_id" id="" class="form-control">
                {% for publish_obj in publish_queryset %}
                    <option value="{{ publish_obj.pk }}">{{ publish_obj.title }} </option>
                {% endfor %}
            </select>
        </p>
        <p>作者:
            {# 展示系统所有的作者信息供用户选择一个 #}
            <select name="author_list" id="" class="form-control" multiple>
                {% for author_obj in author_queryset %}
                    <option value="{{ author_obj.pk }}">{{ author_obj.name }}</option>
                {% endfor %}
            </select>
        </p>
        <input type="submit" class="btn btn-warning btn-block" value="添加">
    </form>
{% endblock %}